<template>
	<view class="u-page">
		<view class="header">
		</view>
		<view class="content">
			<view class="projectList" v-if="lists !=''">
				
				<block v-for="(item, index) in lists" :key="index">
					<view class="label">{{item.slProjectByPid.title}}</view>
					<view class="lists" >
						<view class="lists-item">
							<view class="taskimg"><image src="../../../static/icon/task.png" mode=""></image></view>
							<view class="left-item">
								<view class="">金额任务</view>
								<view class="">分享消费满1消费，可获得奖励</view>
							</view>
							<view class="right-item">
								<view>20</view>
								<view>未完成</view>
							</view>
						</view>
						<view class="speed">
							<uni-section >
								<uni-steps :options="list1" :active="active" />
							</uni-section>
						</view>
					</view>
				</block>
			</view>
			<view class="projectList" v-else>
				<view class="label">暂无任务</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userData:'',
				lists:[],
				list1: [{
					title: '事件一'
				}, {
					title: '事件二'
				}, {
					title: '事件三'
				}, {
					title: '事件四'
				}],
				active:'2'
			}
		},
		onLoad(data) {
			let user = uni.getStorageSync('userData');
			this.userData = user;
			this.project()
			
		},
		methods: {
			goback(){
				uni.navigateBack({
					delta: 1
				})
			},
			async project(){
				//获取我的hll会员信息
				const project1 = await this.GQL({
					"operationName": "allSlUserProjectvips",
					"query": "query allSlUserProjectvips($filter: SlUserProjectvipFilter) { allSlUserProjectvips(filter:$filter) { nodes { pid slProjectByPid { title slProjectStoreTasksByPid { nodes { where1 reward online tid pid } } } } } }",
					"variables": {"filter": {"uid":{"equalTo":this.userData.uid}}}
				})
				let that = this
				console.log('1------',project1.data.allSlUserProjectvips.nodes)
				if(project1.data.allSlUserProjectvips.nodes !=''){
					that.lists = project1.data.allSlUserProjectvips.nodes
					
				}
			},
			async tasklist(pid,index){
				const task = await this.GQL({
					"operationName": "allSlProjectStoreTasks",
					"query": "query allSlProjectStoreTasks($filter: SlProjectStoreTaskFilter) { allSlProjectStoreTasks(filter:$filter) { nodes { where1 uid type tid reward pid online createtime } } }",
					"variables": {"filter": {"pid":{"equalTo":pid}}}
				})
				if(task.data.allSlProjectStoreTasks.nodes !=''){
					this.lists[index].tasklist = task.data.allSlProjectStoreTasks.nodes
				}
			}
			
		}
	}
</script>

<style lang="scss">
.u-page{
		background-color: #FBFCFE;
	}
	 .header{
	 	width: 100%;
	 	height: 200px;
	 	/* color: #FFFFFF; */
	 	background: linear-gradient(#C7171E, #f0f2f5); /* 标准的语法 */
	 	
	 }
	.content{
		position: relative;
		top: -200px;
		
		margin: 15px;
		.label{
			font-size: 16px;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #161E3E;
			line-height: 16px;
			margin: 10px;
			padding-top: 10px;
		}
		.taskimg{
			position: absolute;
			image{
				width: 28px;
				height: 28px;
				
			}
		}
		.projectList{
			background-color: #FFFFFF;
			border-radius: 5px;
			min-height: 500px;
			.lists{
				padding-top:10px ;
				margin: 0px 10px;
				
			}
			.lists-item{
				// width: 200px;
				height: 56px;
				background-color: #F9F9F9;
				margin-left: 10px;
			}
			
			
		}	
	}

</style>